##############################################
#    Makefile for Sina-Memcached-Lite
#              by sskaje
#
# Usage:
#    make 
#    make clean
#    make install PREFIX=/usr/local/memcached
#    make uninstall
##############################################

CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2 -I ./ -I /opt/local/include/
PREFIX = /usr/local/httpban
INSTALL = /usr/bin/install -c
LDFLAGS = -L/opt/local/lib/ -Wall -levent -lpthread
bindir = ${PREFIX}/bin
binfiles = httpban
libfiles = storefile.o httpban.o trie.o

all: $(binfiles)

$(binfiles): $(libfiles)
	$(CC) $^ -o $@ $(LDFLAGS)

clean:
	rm -f -- *.o

install:
	mkdir $(bindir)
	$(INSTALL) $(binfiles) $(bindir)/$(binfiles)

uninstall:
	rm -f $(bindir)/$(binfiles)
